#include <bits/stdc++.h>
#define double long double
using namespace std;

char buf[1 << 23], *p1 = buf, *p2 = buf;
#define getchar() (p1 == p2 and (p2 = (p1 = buf) + fread(buf, 1, 1 << 23, stdin), p1 == p2) ? EOF : *p1++)

inline int read() {
	int x = 0, f = 0; char ch = getchar();
	while (ch < '0' or ch > '9') f |= (ch == '-'), ch = getchar();
	while (ch >= '0' and ch <= '9') x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

int __stk[128], __top;
inline void write(int x) {
    if(x < 0) putchar('-'), x = -x;
	do { __stk[++__top] = x % 10, x /= 10; } while (x);
	while (__top) putchar(__stk[__top--] + '0');
}

const int mod = 998244353;

void Min(int &x, int y) { y < x and (x = y); }
void Max(int &x, int y) { y > x and (x = y); }

void Max(double &x, double y) { y > x and (x = y); }

void inc(int &x, int y) { (x += y) >= mod and (x -= mod); }
void mul(int &x, int y) { x = 1ll * x * y % mod; }

int q_pow(int x, int k) { int res = 1; for (; k; k >>= 1, mul(x, x)) if (k & 1) mul(res, x); return res; }

bool stmer;

const int N = 1e6 + 10, M = 1e9;

int n, top;

double h[N], r[N], R[N];

double ans;
double f[N];

struct line {
    double k, b, l, r;
    double f(double x) { return b + k * x; }
} stk[N];

bool edmer;
signed main() {
	freopen("wan.in", "r", stdin);
	freopen("wan.out", "w", stdout);
	cerr << "[Memory] " << (&stmer - &edmer) / 1024 / 1024 << " MB\n";
	
    n = read(); double mx = 0;
    for (int i = 1; i <= n; i++) {
        h[i] = read(), r[i] = (double) read() / 2, R[i] = (double) read() / 2;
        double k = h[i] / (R[i] - r[i]), len = R[i] - r[i]; f[i] = mx;

        while (top) {
            line l = stk[top];
            if (r[i] >= l.r) { Max(f[i], l.f(l.r)), top--; continue; }
            if (k > l.k) {
                Max(f[i], l.f(max(l.l, r[i])));
                if (k * len + f[i] < l.f(l.r)) break; top--;
            }
            else {
                Max(f[i], l.f(min(l.r, R[i])) - k * (min(l.r, R[i]) - r[i]));
                if (k * len + f[i] < l.f(l.r)) break; top--;
            }
        }
        stk[++top] = { k, f[i] - r[i] * k, r[i], R[i] };
        Max(ans, f[i] + h[i]), mx = max(mx, f[i]);
    }

    printf("%.12Lf\n", ans);

    cerr << "[Runtime] " << (double) clock() / CLOCKS_PER_SEC << " seconds\n";
	return 0;
} 